package com.example.day2.adapter;

import android.view.View;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.day2.R;
import com.example.day2.entity.GoodsTableResult;

public class SmallTypeAdapter extends BaseQuickAdapter<GoodsTableResult.DataBean.DataBean1, BaseViewHolder> {
    public SmallTypeAdapter(int layoutResId) {
        super(layoutResId);
    }



    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, GoodsTableResult.DataBean.DataBean1 dataBean1) {
        baseViewHolder.setText(R.id.tv,dataBean1.getCategory_name());
        ImageView view = baseViewHolder.getView(R.id.iv);
        Glide.with(getContext()).load(dataBean1.getCategory_icon()).into(view);
    }
}
